<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
>
<ul th:fragment="head-right" class="layui-nav layui-layout-right">
  <!-- 当用户未时展示登录，注册按钮，个人中心也跳转登录 -->
  <li th:if="${session.user == null}" class="layui-nav-item"><a href="/home/login?source=personalCenter">个人中心</a></li>
  <li th:if="${session.user == null}" class="layui-nav-item"><a href="/reg">无账号，去注册</a></li>
  <li th:if="${session.user == null}" class="layui-nav-item"><a href="/home/login?source=distribution">有账号，去登录</a></li>
  <!-- 当用户未时展示登录，注册按钮 -->
  <li th:if="${session.user != null}" class="layui-nav-item">欢迎您：<span th:text="${session.user.name}"></span></li>
  <li th:if="${session.user != null}" class="layui-nav-item"><a href="/personalCenter">个人中心</a></li>
  <li th:if="${session.user != null}" class="layui-nav-item"><a href="/logout">退出</a></li>
</ul>
</html>